
package org.idea.spring.dependency.inject.type;

import javax.annotation.PostConstruct;
import java.util.Arrays;

public class User {
        private int id;
        private String name;
        private Integer age;
        private City[] cities;

        public User() {
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getAge() {
            return age;
        }

        public void setAge(Integer age) {
            this.age = age;
        }

        public City[] getCities() {
            return cities;
        }

        public void setCities(City[] cities) {
            this.cities = cities;
        }

        @PostConstruct
        public void init(){
            System.out.println("this is init");
        }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", cities=" + Arrays.toString(cities) +
                '}';
    }
}